package com.api.phm.domain.query;

import com.alibaba.fastjson2.JSONObject;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

@Getter
@Setter
public class AlarmLogQuery {
    private String alarmId;
    private Long ruleId;
    private JSONObject localRuleName;
    private Long plcId;
    private JSONObject localPlcName;
    private Long lineId;
    private JSONObject localLineName;
    private Long robotId;
    private JSONObject localRobotName;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;
    private JSONObject deviceMap;
    private int alarmLevel;
    private String alarmStatus;
    private String alarmStatusLabel;
    private String alarmMessage;
    private JSONObject trigger;
    private String readMark;
    private String readMarkLabel;

    public void setTrigger(String triggerVal) {
        this.trigger = JSONObject.parseObject(triggerVal);
    }

    public void setLocalRuleName(String localRuleName) {
        this.localRuleName = JSONObject.parseObject(localRuleName);
    }

    public void setLocalPlcName(String localPlcName) {
        this.localPlcName = JSONObject.parseObject(localPlcName);
    }

    public void setLocalLineName(String localLineName) {
        this.localLineName = JSONObject.parseObject(localLineName);
    }

    public void setRobotLineName(String localRobotName) {
        this.localRobotName = JSONObject.parseObject(localRobotName);
    }

    public void setDeviceMap(String deviceMap) {
        this.deviceMap = JSONObject.parseObject(deviceMap);
    }
}
